﻿window.onload = function ()
{
    function mousewheelEvent(e, delta) {
        document.getElementById("debug").innerHTML += (delta + "");
        // 其它代码...
    }
}

if (document.attachEvent) {
    document.attachEvent("onmousewheel", function (e) {
        mousewheelEvent(e, e.wheelDelta);
    });
}
else if (document.addEventListener) {
    document.addEventListener("DOMMouseScroll", function (e) {
        mousewheelEvent(e, e.detail * -40);
    }, false);
}